﻿using SharpDX;

namespace FadeGameFramework.DevTest
{
    internal class TestSprite : Sprite
    {
        private Vector2 v = new Vector2(10, 10);

        public TestSprite()
            : base("Content/Sasuke-fireball.png", 23, 1, 0.1f) {
            Tag = "TestSprite";
            Zorder = int.MaxValue;
        }

        public override void Update(float dt) {
            Position += v*dt;
            if (PositionX + FrameSize.Width > 1024 || PositionX < 0) {
                v *= new Vector2(-1, -1);
            }
            else if (PositionY + FrameSize.Height > 768 || PositionY < 0) {
                v *= new Vector2(-1, -1);
            }
        }
    }
}